package cn.itsource.openfeign.fallback;

import cn.itsource.openfeign.CourseFeignClient;
import cn.itsource.ymcc.common.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class CourseFeignClientFallbackFactory implements FallbackFactory<CourseFeignClient> {
    @Override
    public CourseFeignClient create(Throwable throwable) {
        return new CourseFeignClient() {
            @Override
            public JsonResult getUserLearnByLoginId(Long loginId) {
                return JsonResult.error("getUserLearnByLoginId调用失败");
            }

            @Override
            public JsonResult get(Long id) {
                return JsonResult.error("get调用失败");
            }
        };
    }
}
